package com.ww.springboot.boot.test;

import com.ww.springboot.boot.utils.Func;
import com.ww.springboot.boot.utils.StringUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * 描述：
 *
 * @author 🧑 ‍wanwei
 * @since 2025-03-28 09:43
 */
public class SqlCommon {

    public static void main(String[] args) {
        String sf = "2025_1,2025_2,2025_3,2025_4";
//		String tb = "otms_order,otms_order_goods,otms_order_times,otms_order_cost_detail,otms_order_cost,otms_order_receiver,otms_order_parcel,otms_order_seller,otms_order_sender";
        String tb = "trace_order_base_2024q4";
        List<String> sql = new ArrayList<>();
        for (String table : Func.splitTrim(tb, ',')) {
            for (String suffix : Func.splitTrim(sf, ',')) {
                String s = StringUtil.format("CREATE TABLE IF NOT EXISTS {} LIKE {};", table + "_" + suffix, table);
                sql.add(s);
            }
        }
        System.out.println(sql);
    }
}
